<?php
require_once("../inc/conn.php");
require_once("../inc/session.php");
//接收传递来的值
$id=$_POST["id"];
$name=$_POST["name"];
$depart=$_POST["depart"];
$pass=$_POST["pass"];
$pass1=$_POST["pass1"];
$sex=$_POST["sex"];
$weixin=$_POST["weixin"];
$address=$_POST["address"];
$ck=implode(",",$_POST["ck"]);

//定义SQL语句  实现写入
$sql="update userinfo set name='".$name."',sortid='".$depart."',pass='".$pass."',sex='".$sex."',weixin='".$weixin."',address='".$address."',ck='".$ck."',dt=now() where id=".$id;
//执行sql语句
$rs=$conn->query($sql);
if($rs){
	echo "<script>alert('更新成功！');location.href='userlist.php';</script>";
}else{
	echo "<script>alert('更新失败！');location.href='userlist.php';</script>";
}
?>